
const defineReactive = (data) => {
    if (Utils.is2type(data, "object")) {
        for (const props of Object.keys(data)) {
            let value = data[props];
            Object.defineProperty(data, props, {
                enumerable: true,
                configurable: true,
                set(newVal) {
                    if (value != newVal) value = newVal;
                    // if (Utils.is2type(value, "object")) {
                    //     defineReactive(data[props]);
                    // }
                },
                get() {
                    console.log(props, value);
                    return value;
                }
            });
            defineReactive(value);
        }
    }
}

let person = {
    name: "陌客",
    sex: "男",
    age: 8,
    core: {
        work: "IT",
    },
};

console.log(person);
defineReactive(person);